<?php

  include_once( '../library/config.php' );
  include_once( LANGUAGE.'language.php' );
  include_once( APPLICATION.'User.class.php' );
  
  $_page = 'greentab';
  $_pname = 'Punts verds';
  
  if( User::checkLogged() )
  {
    $user = User::findByEmail( $_SESSION['email'] );
    
    if( $user )
    { 
      include_once( PUBLIC_TEMPLATES.$_SESSION['langShort'].'/header.tmp.php' );
      
      include_once( PUBLIC_TEMPLATES.$_SESSION['langShort'].'/greenpoints.tmp.php' );
      
      include_once( PUBLIC_TEMPLATES.$_SESSION['langShort'].'/footer_logged.tmp.php' );
      
      include_once( PUBLIC_TEMPLATES.$_SESSION['langShort'].'/footer.tmp.php' );
    }
    else
    {
      header( 'Location: index.php' );
    } 
  }
  else
    header( 'Location: index.php' );

?>